home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / gamma-bros.swf / scripts / __Packages / classes / shots / DeathNode.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  708 b   |  31 lines

  1. class classes.shots.DeathNode
  2. {
  3.    var x;
  4.    var y;
  5.    var id;
  6.    var clip;
  7.    var power = 20;
  8.    function DeathNode(px, py, pid)
  9.    {
  10.       this.x = px;
  11.       this.y = py;
  12.       this.id = pid;
  13.       _root.d = _root.d + 1;
  14.       this.clip = _root.attachMovie("deathNode","deathNode" + this.id + "Clip",_root.d + 1000);
  15.       this.clip._x = this.x;
  16.       this.clip._y = this.y;
  17.       this.clip.id = this.id;
  18.    }
  19.    function main()
  20.    {
  21.       if(this.clip.hitTest(_root[_root.char + "Clip"]))
  22.       {
  23.          _root[_root.char].hit(random(4),random(4),100,this.power);
  24.       }
  25.       if(this.clip.end)
  26.       {
  27.          _root.removeEnemyShot("deathNode" + this.id);
  28.       }
  29.    }
  30. }
  31.